package com.kly.smartbi.test.day08;

import java.util.Scanner;

/**
 * @author admin
 * @date 2025/4/10
 */
public class Demo1 {

    public static void main(String[] args) {
        // 在此输入您的代码...
        nineToTen();

    }


    /**
     * 分布式队列
     */
    public static void queue() {
        Scanner scan = new Scanner(System.in);
        // 在此输入您的代码...
        int n = scan.nextInt();
        int[] arr = new int[n];
        while (scan.hasNext()) {
            // 读取操作
            String op = scan.next();
            if ("add".equals(op)) {
                int a = scan.nextInt();
                arr[0]++;
            } else if ("sync".equals(op)) {
                int a = scan.nextInt();
                arr[a]++;
            } else {
                // 查询操作
                // 求出数组中最小值
                int min = 0;
                for (int j : arr) {
                    if (min > j) {
                        min = j;
                    }
                }
                System.out.println(min);
            }
        }
        scan.close();
    }

    /**
     * 九进制转十进制
     */
    public static void nineToTen() {
        Scanner scan = new Scanner(System.in);
        int num = 2022;
        int count = 0;
        int sum = 0;
        while (num > 0) {
            int a = num % 10;
            sum += ((int) Math.pow(9, count)) * a;
            count++;
            num /= 10;
        }
        System.out.println(sum);
        scan.close();

        num = 2022;
        int i = Integer.parseInt(num + "", 9);
        System.out.println(i);
    }

}
